home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / falcon / nt_dsp2.lzh / NT_DSP2.MSA / BENCH / 1-96 < prev    next >
Encoding:
Text File  |  1988-07-19  |  5.0 KB  |  117 lines

  1.     page 132,66,0,6
  2.         opt     rc
  3. ;*******************************************
  4. ;Motorola Austin DSP Operation  June 30,1988
  5. ;*******************************************
  6. ;DSP96001/2
  7. ;20 tap FIR filter
  8. ;File name: 1-96.asm
  9. ;**************************************************************************
  10. ;    Maximum sample rate: 435.5 KHz at 27.0 MHz
  11. ;    Memory Size: Prog: 4+9 words ; Data :2 x 20 words
  12. ;    Number of clock cycles:    62 (31 instruction cycles)
  13. ;    Clock Frequency:    27.0 MHz
  14. ;    Cycle time:        74.1ns
  15. ;**************************************************************************
  16. ;    This FIR filter reads the input sample
  17. ;    from the memory location Y:input
  18. ;    and writes the filtered output sample
  19. ;    to the memory location Y:output
  20. ;
  21. ;    The samples are stored in the X memory
  22. ;    The coefficients are stored in the Y memory
  23. ;**************************************************************************
  24. ;
  25. ;          X MEMORY                               Y MEMORY
  26. ;
  27. ;         |        |                             |        |
  28. ;    R0   |--------|                             |--------|
  29. ;  +----->|  X(n)  |                      +----->|  c(0)  |
  30. ;  |  t   |--------|                      |t,t+T |--------|
  31. ;  |      | X(n-1) |                      |      |  c(1)  |
  32. ;  |      |--------|                      |      |--------|
  33. ;  |      |        |                      |      |        |
  34. ;  |      |        |                      |      |        |
  35. ;  |      |        |                      |      |        |
  36. ;  |      |        |                      |      |        |
  37. ;  |      |--------|                      |      |--------|
  38. ;  +----->|X(n-k+1)|  X(n+1)              +<-----| c(k-1) |
  39. ;   t+T   |--------|                             |--------|
  40. ;         |        |                             |        |
  41. ;
  42. ;
  43. ;                              C(0)                      
  44. ;                              ___          ___
  45. ;    x(n)                     /   \        /   \         y(n)
  46. ;    -------------+----------|  X  |----->|  +  |--------->
  47. ;                 |           \___/        \___/
  48. ;                 |                          ^             k-1
  49. ;                 |                          |             ____
  50. ;              +-----+                       |             \   '
  51. ;              |  T  |         C(1)          |      y(n)=  /___,c(p)x(n-p)
  52. ;              +-----+         ___           |             p=0
  53. ;                 |           /   \          |
  54. ;                 +----------|  X  |-------->+  
  55. ;                 |           \___/          |
  56. ;              +-----+                       |
  57. ;              |  T  |         C(2)          |
  58. ;              +-----+         ___           |
  59. ;                 |           /   \          |
  60. ;                 +----------|  X  |-------->+   
  61. ;                 |           \___/          |
  62. ;                 |                          |
  63. ;                 |                          |
  64. ;                 |                          |
  65. ;                 |                          |
  66. ;                 |                          |
  67. ;                 |                          |
  68. ;              +-----+                       |
  69. ;              |  T  |         C(K-1)        |
  70. ;              +-----+         ___           |
  71. ;                 |           /   \          |
  72. ;                 +----------|  X  |-------->+     
  73. ;                             \___/
  74. ;
  75. ;
  76. ;                            F I R
  77. ;
  78. ;**************************************************************************
  79. ;
  80. ;    initialization
  81. ;**********************
  82. n    equ    20
  83. start    equ    $40
  84. data    equ    $0
  85. coef    equ    $0
  86. input    equ    $ffe0
  87. output    equ    $ffe1
  88. ;
  89. ;                                                     Program  Icycles
  90. ;                                                      Words
  91. ;
  92.     move     #data,r0                                 ;    1      1
  93.     move     #coef,r4                                 ;    1      1
  94.     move     #n-1,m0                                  ;    1      1
  95.     fclr     d1               m0,m4                   ;    1      1
  96. ;                                  ---    ---
  97. ;    Filter loop: n+11 cycles               4      4
  98. ;****************************************************
  99.     movep                     y:input,d0.l          ;       1      2
  100.     float    d0,d0                      ;       1      1
  101.     move                      d0.s,x:(r0)             ;    1      1
  102.     fclr     d0               x:(r0)+,d4.s   y:(r4)+,d6.s ;1      1
  103.     rep #n                                            ;    1      2
  104.     fmpy d4,d6,d1 fadd  d1,d0 x:(r0)+,d4.s   y:(r4)+,d6.s ;1      1
  105.                   faddr d1,d0   (r0)-                 ;    1      1
  106.     int      d0,d0                              ;    1      1
  107.     movep                     d0.l,y:output           ;    1      2
  108. ;****************************************************
  109.                                                  ; --------------------
  110.                           ;         9    n+11
  111.  
  112.                                                  ; Totals  13    1N+15
  113.                                                  ;        (13    1N+15)
  114.     end
  115.  
  116.  
  117.